package com.czk.model.proxy.cglibproxy.pra;


import org.springframework.cglib.proxy.Enhancer;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/12/21 22:57
 */
public class PersonCglibFactory {
    public static <T> T getProxy(Class<T> clazz) {
        // 增强
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clazz);
        enhancer.setCallback(new PersonProxy());
        return (T) enhancer.create();
    }
}
